Preface
For details about log4j2, refer to the previous blog.
A good thing about log4j2 is that you can use configuration file to configure log system. However, the storage location of this configuration file is quite tangled. This article describes how to change the path and name of the log4j2 configuration file.
Directory
The content of this article will answer the following questions:
1. How to generate a logevent?
2. What is the transf
be located the defaultconfiguration would be used. This would cause logging output to go to the console.Visible, if the "Log4j.configurationfile" system property is not set, application will find the configuration file in Classpath in the following order:Log4j2-test.json or LOG4J2-TEST.JSN fileLog4j2-test.xml fileLog4j2.json or LOG4J2.JSN fileLog4j2.xml fileIf you want to rename the configuration file and place it elsewhere, you need to set the system property Log4j.configurationfile.It is set
difficult to mix these features together, and that combining these components is simple for netty, and these components can increase the robustness of the application, usabilityIn the next section, we'll start exploring the design and implementation details of broadcast components13.4 The message Pojo:logeventIn the message application, the data is often represented by a pojo, which contains some configuration information or some processing information and even some real information, in this ap
window for interaction, the Code is as follows:Define two member functions: customfunc1 and customfunc2Void cservicemodule: customfunc1 (){Tchar szfilepath [max_path + 1];Getmodulefilename (null, szfilepath, max_path );(_ Tcsrchr (szfilepath, _ T ('\') [1] = 0; // delete the file name and only obtain the pathCstring str_url = szfilepath;Str_url = str_url + "B .exe ";Logevent ("running program:" + str_url );Uint RTN = winexec (str_url, sw_show );
// U
on. Whether this information is set up correctly or not, determines if your service program starts and runs normally.
Uninstall, deletes the service specified by the current Ntsvc.ocx from the system registry. The NT service depends on the setup of the system service registry, which is a well-known secret.
StartService, start the specified service if the service is registered.
StopService, stop the service if the service is running.
LogEvent, log ser
folder. (Note: If you are upgrading your flurry IOS SDK, make sure that the dependent library files for the flurry in your project folder are deleted before you do this)(2) Add flurry to your project and select "Create groups for any added folders", tick the target you want to integrate.(3) Add Systemconfiguration.framework to your app. This is the framwork required to efficiently manage the reachability of network operations.(4) in the deletegate you use for the program, import the Flurry and
. Reference controlsSelect "project"-"Reference"-"Microsoft NT Service Control". If not, set ntsvc first. copy OCX to % system32 %/, and then select Browse in the reference dialog box to add the control.
2. Main Code Private sub form_load ()On Error goto serviceerror'Install the serviceIf command = "/I" thenNtservice. Interactive = trueIf ntservice. Install thenNtservice. savesetting "Parameters", "timerinterval", "300"Msgbox ntservice. displayname ": installed successfully"ElseMsgbox ntservic
;TrueOptional> Dependency>Version is 1.0.0. Note that there are some dependencies that need to be downloaded from the Twitter repository, so you know: please bring your own ladder.Sample program:private void process (Message message) {Msgbuffer. Add(message);if (msgbuffer. Size() ;try {Notifications. Notifybegintransaction(Morphline);for (Message msg:msgbuffer) {Event logEvent = Gson. Fromjson(New String (msg. GetContent()), Event. Class);Strin
Servertag: the server tag for submitting logs, for example, 192.168.0.1.
Appname ApplicationProgramFor example, game
The maximum number of records stored in maxrecords memory. When the number of logs exceeds the threshold, data is submitted.
Timer timed submission time Message Storage Structure
Public Class Logevent { Public Logevent () {errors = New List ();} Public String Eventtype
Systemconfiguration.framework.
Next we open AppDelegate.m , in the - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions method, add the code [Flurry startSession:@"X28BBKTNZ9H3VYTBDBG3"]; , as shown in:In this way, the simplest integration of the flurry is completed. With just a few steps above, flurry can help us to complete the statistics and analysis of the basic usage data of the application.Custom statistics ItemsFlurry provi
Service programs (services) generally can not interact with the user, so he is generally unable to display the window. To interact with the user (such as the display window), we must open the user WinSta0 and desktop, and the following code opens the above two and displays a dialog:
BOOL Cservicemodule::showmsgdlg (void){Hdesk hdeskcurrent;Hdesk Hdesk;Hwinsta hwinstacurrent;Hwinsta Hwinsta;Hwinstacurrent = Getprocesswindowstation ();if (hwinstacurrent = = NULL) {
How to display a dialog box in a service program
Author: ac952_z_cn
Download source code
Service programs (services) generally can not interact with the user, so he is generally unable to display the window. To interact with the user (such as the display window), we must open the user WinSta0 and desktop, and the following code opens the above two and displays a dialog:
BOOL Cservicemodule::showmsgdlg (void) {Hdesk hdeskcurrent;
Hdesk
.
The dictionary that describes the object. The DLL attributes specify the resource icon in the directory and serve as the second icon in the browser tree. You can specify the dll path and ICO resource number for other icons. If nothing is specified, there is also an icon, but it is not very nice. Based on the execution result of the node, qtp also puts the incorrect check box and the Red Cross icon in front.
Qtp custom report entry
Dim curnodeid, childnodeidCurnodeid = Reporter. getconte
21. Custom Exception Handling
// Custom exception handling classUsing system;Using system. diagnostics;Namespace myappexception{/// /// Application exception handling class inherited from the system exception class applicationexception./// Automatically record the exception content to the application logs of Windows NT/2000/// Public class appexception: system. applicationexception{Public appexception (){If (applicationconfiguration. eventlogenabled) logeve
applicationexception./// Automatically record the exception content to the application logs of Windows NT/2000/// Public class appexception: system. applicationexception{Public appexception (){If (applicationconfiguration. eventlogenabled) logevent ("an unknown error occurs. ");}
Public appexception (string message){Logevent (Message );}
Public appexception (string message, exception innerexception){
the system exception class applicationexception./// Automatically record the exception content to the application logs of Windows NT/2000/// Public class appexception: system. applicationexception{Public appexception (){If (applicationconfiguration. eventlogenabled)Logevent ("an unknown error occurs. ");}
Public appexception (string message){Logevent (Message );}
Public appexception (string message, except
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.